﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using EZMemoLib;

namespace Remember.WPF.Views
{
    /// <summary>
    /// Interaction logic for StatusBar.xaml
    /// </summary>
    public partial class StatusBar : UserControl
    {
        ItemStatus _Current = null;
        public ItemStatus Current { set {
            _Current = value;
            Bind();
        }
            get {
                return _Current;
            }
        }
        public StatusBar()
        {
            InitializeComponent();


        }

        public void Bind()
        {
            if (_Current != null)
            {
                //TODO: here will add anim
                uiBookName.Text = Current.BookName;
                uiLessonName.Text = Current.Lesson;
                uiDiff.Text = string.Format("{0}", Current.Diff);
                uiRepetition.Text = string.Format("{0}", Current.Repetition);
                uiTotal.Text = string.Format("{0}", Current.Total);
                uiLatest.Text = Current.Latest;
            }
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {

        }
    }
}
